<?php
/**
 * Created by PhpStorm .
 * User: {Administrator}
 * Date: {2022/7/8 16:42}
 * Author: '树叶'
 * Email: 'ayunu@qq.com'
 * Motto Info: '理想如果不向现实做一点点屈服，那么理想也将归于尘土。'
 */

namespace app\api\model;
use think\Model;
use think\Db;

class Brand extends Model
{
    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $resultSetType = 'collection';
    // 追加属性
    protected $append = [

    ];

    /**
     * 获取单个品牌
     */
    public function getBrand($id)
    {
        $res = Db::name('brand')->where('id','in',$id)->column('id,name');
       
        if (!$res) return false;
        return $res;
    }


    /**
     * 品牌列表
     */
    public function Getbrandlist()
    {
         return Db::name('brand')->field('id,name,logoimage,brandurl,content')->where('status',0)->select();
    }


}